﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Experimental8.Infrastructure.Helpers;

namespace Experimental8.Modules.CommonDictionaries
{
    /// <summary>
    /// Interaction logic for ContractorGroupsView.xaml
    /// </summary>
    //Change. Изменить на интерфейс
    [Export(typeof(ContractorGroupsView))]
    [PartCreationPolicy(CreationPolicy.Shared)]
    public partial class ContractorGroupsView : UserControl
    {
        public ContractorGroupsView()
        {
            InitializeComponent();
        }

        [Import]
        public ContractorGroupsViewModel ViewModel
        {
            get
            {
                return this.DataContext as ContractorGroupsViewModel;
            }
            set
            {
                this.DataContext = value;
            }
        }

        private void DataGrid_AutoGeneratingColumn_1(object sender, DataGridAutoGeneratingColumnEventArgs e)
        {
            //Change. Изменить на интерфейс
            ContractorGroupsViewModel viewmodel = this.DataContext as ContractorGroupsViewModel;
            UIBuilderHelpers.MakeDataGridColumnByBDInfo(e, viewmodel.ContractorGroups_Fields_Information);


        }

    }
}
